home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / IM_Install3.adf / dd.LZH / neg.rexx < prev    next >
OS/2 REXX Batch file  |  1991-11-08  |  2KB  |  66 lines

  1. /* ARexx - Negative does a simple negative operation in IM */
  2.  
  3. /*
  4.  * This is how to do a 'process' operation. Processes are very simple,
  5.  * all you need to do is backup the image to the undo buffer,
  6.  * then run the process, then redraw. That's all there is to it!
  7.  *
  8.  * If you want to do image loaders and savers, see the examples used
  9.  * for the PMBC format. There is considerably more involved
  10.  * ARexx logic involved in deciding what to do with the new buffer,
  11.  * allocating the right size (you have to look at the source image
  12.  * to see what that size is!). Anyway, it's still pretty easy.
  13.  *
  14.  * Feel free to use our examples as 'boilerplate' for your own work.
  15.  */
  16.  
  17. /*
  18.  * open rexxsupport.library -- needed for some functions
  19.  */
  20. if ~show('L',"rexxsupport.library") then do
  21.   if addlib('rexxsupport.library',0,-30,0) then do
  22.       /* everything's ok */
  23.     end;
  24.   else do
  25.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  26.     say 'Cannot operate NEG.rexx without this library - sorry!';
  27.     exit 10;
  28.     end;
  29.   end;
  30. /*
  31.  * This will automatically direct the script to the proper
  32.  * software, if it is running. No matter where the script is
  33.  * launched from.
  34.  */
  35. prtnme = 'IP_Port'; /* assume Image Professional */
  36. if show('P','IP_Port') = 0 then do
  37.   if show('P','IM_Port') = 0 then do
  38.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  39.     say "This script requires IP, IM or IM F/c to run!";
  40.     exit(20);
  41.     end;
  42.   else do
  43.     prtnme = 'IM_Port'; /* That's the thing about assumptions... */
  44.     end;                 /* We make em, user's break em.          */
  45.   end;
  46.  
  47. address(prtnme); /* talk to image system user is running */
  48.  
  49. 'wbtofront';
  50.  
  51. options results;
  52. 'jackin';        /* get the pointer to the Public Interface */
  53. jacker = result;
  54. options;
  55.  
  56. 'backuptoundo';       /* make sure user can UNDO the result */
  57.  
  58. address command;
  59. 'negative '||jacker;  /* run the actual operation (See the 'c' code) */
  60. address(prtnme);
  61.  
  62. 'tofront';            /* processor screen to front */
  63. 'redraw';             /* redraw results            */
  64.  
  65. exit 0;
  66.